package cc.liyinghao.common.pojo;

import cc.liyinghao.common.en.MessageType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user_messages")
@ApiModel(value = "webSocket发送的对象", description = "消息表")
public class Message{

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "消息ID")
    private Integer id;

    @ApiModelProperty(value = "逻辑删除（0：不显示，1：显示）")
    private Integer isDel;

    @ApiModelProperty(value = "发送者ID")
    private Integer fromId;

    @ApiModelProperty(value = "接收者ID（用户ID或群组ID）")
    private Integer toId;

    @ApiModelProperty(value = "群组ID（私信时为NULL）")
    private Integer groupId;

    @ApiModelProperty(value = "消息种类")
    private MessageType type;

    @ApiModelProperty(value = "引用消息ID")
    private Integer referenceMsg;

    @ApiModelProperty(value = "消息内容")
    private String content;

    @ApiModelProperty(value = "发送时间")
    private Date createTime;
}
